\(\int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx\) [374]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 74 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a \cot ^5(c+d x)}{5 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d} \]

[Out]

-3/8*a*arctanh(cos(d*x+c))/d-1/5*a*cot(d*x+c)^5/d+3/8*a*cot(d*x+c)*csc(d*x+c)/d-1/4*a*cot(d*x+c)^3*csc(d*x+c)/
d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2917, 2687, 30, 2691, 3855} \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a \cot ^5(c+d x)}{5 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d} \]

[In]

Int[Cot[c + d*x]^4*Csc[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

(-3*a*ArcTanh[Cos[c + d*x]])/(8*d) - (a*Cot[c + d*x]^5)/(5*d) + (3*a*Cot[c + d*x]*Csc[c + d*x])/(8*d) - (a*Cot
[c + d*x]^3*Csc[c + d*x])/(4*d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2917

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = a \int \cot ^4(c+d x) \csc (c+d x) \, dx+a \int \cot ^4(c+d x) \csc ^2(c+d x) \, dx \\ & = -\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}-\frac {1}{4} (3 a) \int \cot ^2(c+d x) \csc (c+d x) \, dx+\frac {a \text {Subst}\left (\int x^4 \, dx,x,-\cot (c+d x)\right )}{d} \\ & = -\frac {a \cot ^5(c+d x)}{5 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {1}{8} (3 a) \int \csc (c+d x) \, dx \\ & = -\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a \cot ^5(c+d x)}{5 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.82 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {a \cot ^5(c+d x)}{5 d}+\frac {5 a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {3 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {3 a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {5 a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d} \]

[In]

Integrate[Cot[c + d*x]^4*Csc[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

-1/5*(a*Cot[c + d*x]^5)/d + (5*a*Csc[(c + d*x)/2]^2)/(32*d) - (a*Csc[(c + d*x)/2]^4)/(64*d) - (3*a*Log[Cos[(c
+ d*x)/2]])/(8*d) + (3*a*Log[Sin[(c + d*x)/2]])/(8*d) - (5*a*Sec[(c + d*x)/2]^2)/(32*d) + (a*Sec[(c + d*x)/2]^
4)/(64*d)

Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.35

method result size
derivativedivides \(\frac {a \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )-\frac {a \left (\cos ^{5}\left (d x +c \right )\right )}{5 \sin \left (d x +c \right )^{5}}}{d}\) \(100\)
default \(\frac {a \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )-\frac {a \left (\cos ^{5}\left (d x +c \right )\right )}{5 \sin \left (d x +c \right )^{5}}}{d}\) \(100\)
risch \(-\frac {a \left (40 i {\mathrm e}^{8 i \left (d x +c \right )}+25 \,{\mathrm e}^{9 i \left (d x +c \right )}-10 \,{\mathrm e}^{7 i \left (d x +c \right )}+80 i {\mathrm e}^{4 i \left (d x +c \right )}+10 \,{\mathrm e}^{3 i \left (d x +c \right )}+8 i-25 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{20 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}\) \(128\)
parallelrisch \(-\frac {\left (\cot ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )-\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {5 \left (\cot ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {5 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-5 \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+5 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-20 \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+20 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+10 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-10 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-60 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right ) a}{160 d}\) \(144\)
norman \(\frac {-\frac {a}{160 d}-\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{64 d}+\frac {a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{40 d}+\frac {7 a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}-\frac {a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}+\frac {a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}-\frac {7 a \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}-\frac {a \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{40 d}+\frac {a \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {a \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{160 d}+\frac {a \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {3 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}\) \(220\)

[In]

int(cos(d*x+c)^4*csc(d*x+c)^6*(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(-1/4/sin(d*x+c)^4*cos(d*x+c)^5+1/8/sin(d*x+c)^2*cos(d*x+c)^5+1/8*cos(d*x+c)^3+3/8*cos(d*x+c)+3/8*ln(cs
c(d*x+c)-cot(d*x+c)))-1/5*a/sin(d*x+c)^5*cos(d*x+c)^5)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (66) = 132\).

Time = 0.27 (sec) , antiderivative size = 160, normalized size of antiderivative = 2.16 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {16 \, a \cos \left (d x + c\right )^{5} + 15 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 15 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 10 \, {\left (5 \, a \cos \left (d x + c\right )^{3} - 3 \, a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{80 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^6*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/80*(16*a*cos(d*x + c)^5 + 15*(a*cos(d*x + c)^4 - 2*a*cos(d*x + c)^2 + a)*log(1/2*cos(d*x + c) + 1/2)*sin(d*
x + c) - 15*(a*cos(d*x + c)^4 - 2*a*cos(d*x + c)^2 + a)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 10*(5*a*co
s(d*x + c)^3 - 3*a*cos(d*x + c))*sin(d*x + c))/((d*cos(d*x + c)^4 - 2*d*cos(d*x + c)^2 + d)*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**4*csc(d*x+c)**6*(a+a*sin(d*x+c)),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.16 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {5 \, a {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {16 \, a}{\tan \left (d x + c\right )^{5}}}{80 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^6*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/80*(5*a*(2*(5*cos(d*x + c)^3 - 3*cos(d*x + c))/(cos(d*x + c)^4 - 2*cos(d*x + c)^2 + 1) + 3*log(cos(d*x + c)
 + 1) - 3*log(cos(d*x + c) - 1)) + 16*a/tan(d*x + c)^5)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 173 vs. \(2 (66) = 132\).

Time = 0.35 (sec) , antiderivative size = 173, normalized size of antiderivative = 2.34 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 5 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 10 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 120 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 20 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {274 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 20 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 40 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 10 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 5 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{320 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^6*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/320*(2*a*tan(1/2*d*x + 1/2*c)^5 + 5*a*tan(1/2*d*x + 1/2*c)^4 - 10*a*tan(1/2*d*x + 1/2*c)^3 - 40*a*tan(1/2*d*
x + 1/2*c)^2 + 120*a*log(abs(tan(1/2*d*x + 1/2*c))) + 20*a*tan(1/2*d*x + 1/2*c) - (274*a*tan(1/2*d*x + 1/2*c)^
5 + 20*a*tan(1/2*d*x + 1/2*c)^4 - 40*a*tan(1/2*d*x + 1/2*c)^3 - 10*a*tan(1/2*d*x + 1/2*c)^2 + 5*a*tan(1/2*d*x
+ 1/2*c) + 2*a)/tan(1/2*d*x + 1/2*c)^5)/d

Mupad [B] (verification not implemented)

Time = 11.26 (sec) , antiderivative size = 289, normalized size of antiderivative = 3.91 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a\,\left (2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-2\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+5\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9-5\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-10\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-40\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+20\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-20\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+40\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+10\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+120\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\right )}{320\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5} \]

[In]

int((cos(c + d*x)^4*(a + a*sin(c + d*x)))/sin(c + d*x)^6,x)

[Out]

(a*(2*sin(c/2 + (d*x)/2)^10 - 2*cos(c/2 + (d*x)/2)^10 + 5*cos(c/2 + (d*x)/2)*sin(c/2 + (d*x)/2)^9 - 5*cos(c/2
+ (d*x)/2)^9*sin(c/2 + (d*x)/2) - 10*cos(c/2 + (d*x)/2)^2*sin(c/2 + (d*x)/2)^8 - 40*cos(c/2 + (d*x)/2)^3*sin(c
/2 + (d*x)/2)^7 + 20*cos(c/2 + (d*x)/2)^4*sin(c/2 + (d*x)/2)^6 - 20*cos(c/2 + (d*x)/2)^6*sin(c/2 + (d*x)/2)^4
+ 40*cos(c/2 + (d*x)/2)^7*sin(c/2 + (d*x)/2)^3 + 10*cos(c/2 + (d*x)/2)^8*sin(c/2 + (d*x)/2)^2 + 120*log(sin(c/
2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(c/2 + (d*x)/2)^5*sin(c/2 + (d*x)/2)^5))/(320*d*cos(c/2 + (d*x)/2)^5*sin(c
/2 + (d*x)/2)^5)